package cn.jinhe.doc.view.action;

import java.util.List;

import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Controller;

import com.opensymphony.xwork2.ActionContext;

import cn.jinhe.doc.base.BaseAction;
import cn.jinhe.doc.domain.Service;
import cn.jinhe.doc.domain.ServiceTopic;
import cn.jinhe.doc.util.QueryHelper;

@Controller
@Scope("prototype")
public class ServiceAction extends BaseAction<Service>{
	 public String list() throws Exception{
			List<Service> serviceList = serviceService.findAll();
			ActionContext.getContext().put("serviceList", serviceList);
			return "list";
			}
		 
		 /*
		  * 删除
		  */
		 public String show() throws Exception{
			Service service = serviceService.getById(model.getId());
			ActionContext.getContext().put("service", service);
			new QueryHelper(ServiceTopic.class, "s")
			.addCondition("s.service=?", service)
			.preparePageBean(serviceTopicService, pageNum, pageSize);

			
			return "show";
		 }
		 

}
